export function handleError(fn: Function) {
  return function (this: any, ...args: any[]) {
    try {
      console.log('....内部', this, args)
      fn.call(this, ...args)
    } catch (error: any) {
      // 统一对错误进行拦截
      if (error === 'cancel') {
        this.$message({
          type: 'info',
          message: '提交已取消',
        })
      } else {
        this.$message({
          type: 'error',
          message: error.message || '提交失败',
        })
      }
    }
  }
}
